// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 添加 POST /api/book/add */
export async function addBookUsingPost(body: API.BookAddRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponselong>('/api/book/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除 POST /api/book/delete */
export async function deleteBookUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseboolean>('/api/book/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** id获取 POST /api/book/id */
export async function getByBookIdUsingPost(body: API.IdRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseBook>('/api/book/id', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 列表获取 POST /api/book/list */
export async function listBookUsingPost(
  body: API.BookQueryRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListBook>('/api/book/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页获取 POST /api/book/list/page */
export async function listBookByPageUsingPost(
  body: API.BookQueryRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageBook>('/api/book/list/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改 POST /api/book/update */
export async function updateBookUsingPost(
  body: API.BookUpdateRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseboolean>('/api/book/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
